<?php

defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'';
if($_RQ['op']=='wxapp_tmplIds'){
	exi('');
}
if($_RQ['op']=='get_accpagetype'){
	if(get_access_setting($_RQ['pluginname'])){
		exi('close_one_page');
	}else{
		exi('isone_page');
	}
}
if($_RQ['op']=='time_days'){
		$year =$_RQ['year']?:date('Y');
		$month = $_RQ['month']?:date('m');
		$day = date("t",strtotime($year.'-'.$month));
		//$day = cal_days_in_month(CAL_GREGORIAN, $month,$year);
		$calendar = array();
		$i = 1;
		while ($i <= $day) {
				$key=$i;
				if ($i < 10) {
					$i = '0' . $i;
				}
				$date=$year . '-' . $month . '-' . $i;
				$calendar[$key] = $date;
				++$i;
		}
		$return['calendar'] = $calendar;
		$weekday=$year . '-' . $month . '-01';
		$return['week'] = date('w', strtotime($weekday));
		$return['kongday']=array();
		for($i=0;$i<$return['week'];$i++){
			$return['kongday'][]=$i;
		}
		
		$years = array();
		$i = 0;
		while ($i <= 10) {
			$years[] = $year + $i;
			++$i;
		}
		$months = array('01','02','03','04','05','06','07','08','09','10','11','12');
		$return['months']=$months;
		$return['years']=$years;
		$return['year']=$year;
		$return['month']=$month;
		exi($return);
}